-- exchange_sp
-- create by cheny3
-- 兑换探索点

return {
    -- 判断
    canTrigger = function(args)
        return true;
    end,

    -- 触发
    trigger = function(args)
        local chanceRange = args["chance"];
        if chanceRange then
            if math.random(chanceRange[2]) > chanceRange[1] then
                -- 概率没触发
                return false;
            end
        end

        local layer = DungeonM.currentLayer();
        if DungeonBankM.canDoExchange(layer) ~= true then
            -- 无法兑换
            return false;
        end

        -- 执行兑换
        return DungeonActionM.go("bank_exchange");
    end,
};
